﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL;
using DHQGHN.DAL.Models.TDT;
using DHQGHN.DAL.ModelsUpload;

namespace DHQGHN.Services.TDT
{
    [ServiceContract]
    public interface IEnumeratorService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="houseHoldID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByID/{enumeratorID}"
            )]
        Enumerator GetByID(string enumeratorID);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle=WebMessageBodyStyle.Bare,
            UriTemplate="GetAll")]
        IEnumerable<Enumerator> GetAll();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAdminCode/{adminCode}")]
        IEnumerable<Enumerator> GetByAdminCode(string adminCode);
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByEnumCode/{enumCode}")]
        Enumerator GetByEnumCode(string enumCode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        //[OperationContract]
        //[WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
        //    UriTemplate = "GetAllByEnumCodePaging/{enumCode}/{pageSize}/{pageIdx}")]
        //IEnumerable<Enumerator> GetAllByEnumCodePaging(string enumCode, string pageSize, string pageIdx);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="household"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddEnumerator")]
        void AddEnumerator(Enumerator enumerator);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="householdID"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteEnumerator")]
        void DeleteEnumerator(DAL.Models.TDT.Enumerator enumerator);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditEnumerator")]
        void EditEnumerator(Enumerator enumerator);

        [OperationContract]
        [WebInvoke(Method = "POST",
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             UriTemplate = "SearchBy")]
        IEnumerable<Enumerator> SearchBy(SearchEnumerator info);

        [OperationContract]
        [WebInvoke(Method = "POST",
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             UriTemplate = "SearchPagingBy")]
        List<Enumerator> SearchPagingBy(SearchEnumerator info);

        [OperationContract]
        [WebInvoke(Method = "POST",
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             UriTemplate = "SearchPagingForAdmin")]
        List<Enumerator> SearchPagingForAdmin(SearchEnumerator info);
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "Checkadminunit/{valuecom}/{value}/{level}")]
        int Checkadminunit(string valuecom, string value, string level);


        /// <summary>
        /// phunx1, 20150613: lay cac thong tin nguoi dung sau khi dang nhap theo UserName
        /// </summary>
        /// <param name="enumCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetInfoByUserName/{userName}")]
        Enumerator GetInfoByUserName(string userName);


        /// <summary>
        /// datlq, 20150619, lay theo admincode va groupcode
        /// </summary>
        /// <param name="enumCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetByAdminGroupCode")]
        List<Enumerator> GetByAdminGroupCode(SearchEnumerator obj);



        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateSignature")]
        JSONMessage UpdateSignature(ENUMERATOR_UPLOAD_SIGNATURE enumerator);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="householdID"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "Delete")]
        EnumeratorDeleteInfo Delete(SearchEnumerator info);
    }
}
